<template>
	<view class="fixtop">
		<fixtitletopVue>
			<template #l>
				<view class="fix-l" @click="back">
					<view>
						<view class="iconfont icon-jiantou"></view>
					</view>
				</view>
			</template>
			<template #c>
				<view class="fix-c">
					浏览历史
				</view>
			</template>
		</fixtitletopVue>
	</view>
	<scroll-view class="conbox" scroll-y>
		<view class="" v-for="(i,index) in uselookhis.lookhisdata" :key="index" @click="goproduct(i)">
			<view class="timebox">{{i.looktime}}</view>
			<productCardVue :data="i" />
		</view>
	</scroll-view>
</template>

<script setup>
	import fixtitletopVue from '../../components/fixtitletop/fixtitletop.vue';
	import productCardVue from '../../components/product-card/product-card.vue';
	import {
		getstatusheight,
		gettitleheight
	} from '@/util/getsysinfo.js'
	import lookhis from '../../store/lookhis';
	const uselookhis = lookhis()
	const heights = getstatusheight() + gettitleheight() + 'px'
	const goproduct = (i) => {
		uni.navigateTo({
			url: `/pages/producet-xq/producet-xq?userid=${i.shoperid}&id=${i.id}`
		})
	}
	const back = () => {
		uni.navigateBack()
	}
</script>

<style lang="scss" scoped>
	.timebox {
		font-size: 25rpx;
		margin-bottom: -20rpx;
		margin-left: 10rpx;
	}

	.conbox {
		height: calc(100vh - v-bind(heights));
		background-color: #eee;
		overflow: hidden;
		padding:  20rpx;
	}

	.fixtop {
		background-color: #eee;
		padding: 0 20rpx;
		border-bottom: 1rpx solid #dcdcdc;
		overflow: hidden;

		.fix-l {
			height: 100%;
			width: 100%;
			display: flex;
			align-items: center;

			.iconfont {
				font-size: 25rpx;
			}
		}

		.fix-c {
			height: 100%;
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 30rpx;
		}
	}
</style>